﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Web;

using UncleBobWebService.Database;

namespace UncleBobWebService.Models
{
    [DataContract]    
    public class RegisterModel
    {
        [DataMember]
        public string Username { get; set; }
       
        [DataMember]        
        public string Password { get; set; }
        
        [DataMember]
        public string FirstName { get; set; }

        [DataMember]
        public string LastName { get; set; }

        [DataMember]
        public string MI { get; set; }

        [DataMember]
        public string PhoneNumber { get; set; }

        [DataMember]
        public string Email { get; set; }

        [DataMember]
        public string Address { get; set; }

        [DataMember]
        public string Message { get; set; }

        [DataMember]
        public bool Status { get; set; }

        [DataMember]
        public PermissionTypes.User Permissions { get; set; }

        public RegisterModel Clone()
        {
            RegisterModel newModel = new RegisterModel();
            if (Address != null)
                newModel.Address = string.Copy(Address);
            if (Email != null)
                newModel.Email = string.Copy(Email);
            if (FirstName != null)
                newModel.FirstName = string.Copy(FirstName);
            if (LastName != null)
                newModel.LastName = string.Copy(LastName);
            if (Message != null)
                newModel.Message = string.Copy(Message);
            if (MI != null)
                newModel.MI = string.Copy(MI);
            if (Password != null) 
                newModel.Password = string.Copy(Password);            
                newModel.Permissions = Permissions;
            if (PhoneNumber != null) 
                newModel.PhoneNumber = string.Copy(PhoneNumber);
                newModel.Status = Status;
            if (Username != null) 
                newModel.Username = string.Copy(Username);

            return newModel;
        }

    }
}